import {get, post} from "./http";

// 判断管理员是否登录成功
export const getLoginStatus = (params) => post(`admin/login/status`,params);

//============用户相关================
//查询所有用户
export const getAllUsers = () => get(`users/allUsers`);
//添加用户
export const setUsers = (params) => post(`users/add`,params);
//编辑用户
export const updateUsers = (params) => post(`users/update`,params);
//删除用户
export const deleteUsers = (id) => get(`users/delete?id=${id}`);

//============商品相关================
//根据类目id查询商品
// export const findByCategoryId = (id) => get(`goods/category/detail?categoryId=${id}`);
export const setGoods = (params) => post(`goods/addGoods`,params);
//编辑商品
export const updateGoods = (params) => post(`goods/updateGoods`,params);
//删除商品
export const deleteGoods = (id) => get(`goods/deleteGoods?id=${id}`);
//添加商品

//根据商品id查询商品对象
// export const findById = (id) => get(`goods/findById?goodsId=${id}`);
//根据商品名获取商品对象
// export const findByName = (goodsName) => get(`goods/categoryByCategoryName?goodsName=${goodsName}`);
//查询所有商品
export const findAllGoods = () => get(`goods/findAllGoods`);

//============订单相关================
// //查询所有订单
// export const getAllOrder = () => get(`order/allOrder`);
// //添加订单
// export const setOrder = (params) => post(`order/add`,params);
// //编辑订单
// export const updateOrder = (params) => post(`order/update`,params);
// //删除订单
// export const deleteOrder = (id) => get(`order/delete?id=${id}`);


//============类目相关================
//查询所有类目
export const getAllCategory = () => get(`category/selectAll`);
//添加类目
export const setCategory = (params) => post(`category/addcategory`,params);
//编辑类目
export const updateCategory = (params) => post(`category/updatecategory`,params);
//删除类目
export const deleteCategory = (id) => get(`category/deletecategory?id=${id}`);



